<style>
    :root {
        --primary: #165DFF;
        --primary-light: #E8F3FF;
        --secondary: #36BFFA;
        --dark: #1D2939;
        --light: #F9FAFB;
        --gray: #667085;
        --border: #E5E7EB;
        --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }

    body {
        font-family: 'Inter', system-ui, -apple-system, sans-serif;
        background-color: var(--light);
        color: var(--dark);
        line-height: 1.7;
        padding-top: 30px;
        padding-bottom: 60px;
    }

    .container {
        max-width: 1200px;
    }

    .page-header {
        text-align: center;
        margin-bottom: 3rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--border);
    }

    .page-header .page-title {
        font-size: 2.2rem;
        font-weight: 700;
        margin-bottom: 0.75rem;
        color: var(--dark);
    }

    .page-header .page-description {
        color: var(--gray);
        max-width: 700px;
        margin: 0 auto;
    }

    .link-section {
        background-color: white;
        border-radius: 12px;
        box-shadow: var(--shadow);
        padding: 2rem;
        margin-bottom: 3rem;
    }

    .link-section .section-title {
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid var(--primary-light);
        color: var(--primary);
        display: flex;
        align-items: center;
    }

    .link-section .section-title i {
        margin-right: 10px;
    }

    /* 网格布局链接 */
    .grid-links {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .grid-link-item {
        transition: transform 0.2s, box-shadow 0.2s;
        border-radius: 8px;
        overflow: hidden;
    }

    .grid-link-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    }

    .grid-link-item a {
        display: block;
        padding: 1rem;
        text-align: center;
        text-decoration: none;
        color: var(--dark);
        background-color: var(--light);
        border-radius: 8px;
        transition: background-color 0.2s;
    }

    .grid-link-item a:hover {
        background-color: var(--primary-light);
        color: var(--primary);
    }

    .grid-link-item .link-logo {
        width: 60px;
        height: 60px;
        margin: 0 auto 0.75rem;
        object-fit: contain;
        border-radius: 4px;
    }

    .grid-link-item .link-name {
        font-weight: 500;
        margin-bottom: 0.25rem;
    }

    .grid-link-item .link-desc {
        font-size: 0.85rem;
        color: var(--gray);
    }

    /* 分类链接 */
    .category-links {
        margin-bottom: 2rem;
    }

    .link-category {
        margin-bottom: 1.5rem;
    }

    .link-category .category-title {
        font-weight: 600;
        margin-bottom: 1rem;
        color: var(--dark);
        display: flex;
        align-items: center;
    }

    .link-category .category-title i {
        margin-right: 8px;
        color: var(--primary);
    }

    .link-category .category-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .link-category .category-link {
        display: inline-flex;
        align-items: center;
        padding: 6px 14px;
        background-color: var(--light);
        border-radius: 20px;
        color: var(--gray);
        text-decoration: none;
        font-size: 0.9rem;
        transition: all 0.2s;
    }

    .link-category .category-link:hover {
        background-color: var(--primary);
        color: white;
    }

    .link-category .category-link i {
        margin-right: 6px;
        font-size: 0.85rem;
    }

    /* 图标链接 */
    .icon-links {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .icon-link-item {
        flex: 1;
        min-width: 250px;
    }

    .icon-link-item .icon-link {
        display: flex;
        align-items: center;
        padding: 1rem;
        text-decoration: none;
        color: var(--dark);
        border-radius: 8px;
        background-color: var(--light);
        transition: all 0.2s;
    }

    .icon-link-item .icon-link:hover {
        background-color: var(--primary-light);
        color: var(--primary);
        transform: translateX(5px);
    }

    .icon-link-item .icon-container {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 1rem;
        color: var(--primary);
        font-size: 1.25rem;
        box-shadow: var(--shadow);
    }

    .icon-link-item .icon-link-text {
        flex: 1;
    }

    .icon-link-item .icon-link-name {
        font-weight: 500;
        margin-bottom: 2px;
    }

    .icon-link-item .icon-link-desc {
        font-size: 0.85rem;
        color: var(--gray);
    }

    /* 申请链接区域 */
    .apply-section {
        background-color: var(--primary-light);
        border-radius: 12px;
        padding: 2rem;
        text-align: center;
    }

    .apply-section .apply-title {
        font-size: 1.3rem;
        font-weight: 600;
        margin-bottom: 1rem;
        color: var(--primary);
    }

    .apply-section .apply-description {
        color: var(--dark);
        max-width: 600px;
        margin: 0 auto 1.5rem;
    }

    .apply-section .btn-apply {
        background-color: var(--primary);
        color: white;
        border: none;
        padding: 10px 24px;
        border-radius: 8px;
        font-weight: 500;
        transition: all 0.2s;
        text-decoration: none;
        display: inline-block;
    }

    .apply-section .btn-apply:hover {
        background-color: #0E42D2;
        transform: translateY(-2px);
    }

    @media (max-width: 768px) {
        .page-header .page-title {
            font-size: 1.8rem;
        }

        .link-section {
            padding: 1.5rem;
        }

        .link-section .section-title {
            font-size: 1.3rem;
        }

        .grid-links {
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        }

        .icon-link-item {
            min-width: 100%;
        }
    }
</style>

<div class="container">
    <!-- 页面标题 -->
    <div class="page-header">
        <h1 class="page-title">友情链接</h1>
        <p class="page-description">
            以下是我们的合作伙伴和推荐网站，欢迎访问交流
        </p>
    </div>

    <!-- 网格布局链接 -->
    <section class="link-section">
        <h2 class="section-title">
            <i class="fas fa-th-large"></i> 精选合作伙伴
        </h2>
        <div class="grid-links">
            <div class="grid-link-item">
                <a href="#" target="_blank" rel="noopener noreferrer">
                    <img src="https://picsum.photos/60/60?random=1" alt="科技资讯网" class="link-logo">
                    <div class="link-name">科技资讯网</div>
                    <div class="link-desc">最新科技动态</div>
                </a>
            </div>

            <div class="grid-link-item">
                <a href="#" target="_blank" rel="noopener noreferrer">
                    <img src="https://picsum.photos/60/60?random=2" alt="设计社区" class="link-logo">
                    <div class="link-name">设计社区</div>
                    <div class="link-desc">创意设计分享</div>
                </a>
            </div>

            <div class="grid-link-item">
                <a href="#" target="_blank" rel="noopener noreferrer">
                    <img src="https://picsum.photos/60/60?random=3" alt="程序员论坛" class="link-logo">
                    <div class="link-name">程序员论坛</div>
                    <div class="link-desc">技术交流平台</div>
                </a>
            </div>

            <div class="grid-link-item">
                <a href="#" target="_blank" rel="noopener noreferrer">
                    <img src="https://picsum.photos/60/60?random=4" alt="摄影部落" class="link-logo">
                    <div class="link-name">摄影部落</div>
                    <div class="link-desc">摄影作品展示</div>
                </a>
            </div>

            <div class="grid-link-item">
                <a href="#" target="_blank" rel="noopener noreferrer">
                    <img src="https://picsum.photos/60/60?random=5" alt="旅行日记" class="link-logo">
                    <div class="link-name">旅行日记</div>
                    <div class="link-desc">旅游攻略分享</div>
                </a>
            </div>

            <div class="grid-link-item">
                <a href="#" target="_blank" rel="noopener noreferrer">
                    <img src="https://picsum.photos/60/60?random=6" alt="美食天地" class="link-logo">
                    <div class="link-name">美食天地</div>
                    <div class="link-desc">美食制作教程</div>
                </a>
            </div>

            <div class="grid-link-item">
                <a href="#" target="_blank" rel="noopener noreferrer">
                    <img src="https://picsum.photos/60/60?random=7" alt="健身社区" class="link-logo">
                    <div class="link-name">健身社区</div>
                    <div class="link-desc">健康生活方式</div>
                </a>
            </div>

            <div class="grid-link-item">
                <a href="#" target="_blank" rel="noopener noreferrer">
                    <img src="https://picsum.photos/60/60?random=8" alt="读书俱乐部" class="link-logo">
                    <div class="link-name">读书俱乐部</div>
                    <div class="link-desc">书籍推荐与评论</div>
                </a>
            </div>
        </div>
    </section>

    <!-- 分类链接 -->
    <section class="link-section">
        <h2 class="section-title">
            <i class="fas fa-list-alt"></i> 分类链接导航
        </h2>
        <div class="category-links">
            <div class="link-category">
                <h3 class="category-title">
                    <i class="fas fa-laptop-code"></i> 科技类
                </h3>
                <div class="category-list">
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-globe"></i> 科技前沿
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-microchip"></i> 人工智能
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-mobile-alt"></i> 移动设备
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-server"></i> 云计算
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-database"></i> 大数据
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-wifi"></i> 物联网
                    </a>
                </div>
            </div>

            <div class="link-category">
                <h3 class="category-title">
                    <i class="fas fa-palette"></i> 创意设计类
                </h3>
                <div class="category-list">
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-paint-brush"></i> 平面设计
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-laptop"></i> UI/UX设计
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-video"></i> 视频制作
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-camera"></i> 摄影作品
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-music"></i> 音乐创作
                    </a>
                </div>
            </div>

            <div class="link-category">
                <h3 class="category-title">
                    <i class="fas fa-blog"></i> 生活休闲类
                </h3>
                <div class="category-list">
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-utensils"></i> 美食博客
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-plane"></i> 旅游攻略
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-book"></i> 阅读分享
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-film"></i> 影视评论
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-gamepad"></i> 游戏资讯
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-seedling"></i> 园艺爱好者
                    </a>
                </div>
            </div>

            <div class="link-category">
                <h3 class="category-title">
                    <i class="fas fa-briefcase"></i> 商业财经类
                </h3>
                <div class="category-list">
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-chart-line"></i> 财经资讯
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-bullhorn"></i> 营销策划
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-hand-holding-usd"></i> 创业指南
                    </a>
                    <a href="#" class="category-link" target="_blank" rel="noopener noreferrer">
                        <i class="fas fa-user-tie"></i> 职场发展
                    </a>
                </div>
            </div>
        </div>
    </section>

    <!-- 图标链接 -->
    <section class="link-section">
        <h2 class="section-title">
            <i class="fas fa-icons"></i> 特色站点推荐
        </h2>
        <div class="icon-links">
            <div class="icon-link-item">
                <a href="#" class="icon-link" target="_blank" rel="noopener noreferrer">
                    <div class="icon-container">
                        <i class="fas fa-university"></i>
                    </div>
                    <div class="icon-link-text">
                        <div class="icon-link-name">知识共享平台</div>
                        <div class="icon-link-desc">汇聚各领域专业知识，促进知识传播与共享</div>
                    </div>
                </a>
            </div>

            <div class="icon-link-item">
                <a href="#" class="icon-link" target="_blank" rel="noopener noreferrer">
                    <div class="icon-container">
                        <i class="fas fa-users"></i>
                    </div>
                    <div class="icon-link-text">
                        <div class="icon-link-name">创业者社区</div>
                        <div class="icon-link-desc">连接创业者与投资人，共享创业资源与经验</div>
                    </div>
                </a>
            </div>

            <div class="icon-link-item">
                <a href="#" class="icon-link" target="_blank" rel="noopener noreferrer">
                    <div class="icon-container">
                        <i class="fas fa-graduation-cap"></i>
                    </div>
                    <div class="icon-link-text">
                        <div class="icon-link-name">在线学习平台</div>
                        <div class="icon-link-desc">提供优质在线课程，助力个人成长与技能提升</div>
                    </div>
                </a>
            </div>

            <div class="icon-link-item">
                <a href="#" class="icon-link" target="_blank" rel="noopener noreferrer">
                    <div class="icon-container">
                        <i class="fas fa-lightbulb"></i>
                    </div>
                    <div class="icon-link-text">
                        <div class="icon-link-name">创意灵感库</div>
                        <div class="icon-link-desc">收集全球优秀创意作品，激发创作灵感</div>
                    </div>
                </a>
            </div>

            <div class="icon-link-item">
                <a href="#" class="icon-link" target="_blank" rel="noopener noreferrer">
                    <div class="icon-container">
                        <i class="fas fa-comments"></i>
                    </div>
                    <div class="icon-link-text">
                        <div class="icon-link-name">行业交流论坛</div>
                        <div class="icon-link-desc">各行业专业人士交流平台，分享行业见解</div>
                    </div>
                </a>
            </div>

            <div class="icon-link-item">
                <a href="#" class="icon-link" target="_blank" rel="noopener noreferrer">
                    <div class="icon-container">
                        <i class="fas fa-newspaper"></i>
                    </div>
                    <div class="icon-link-text">
                        <div class="icon-link-name">新媒体资讯</div>
                        <div class="icon-link-desc">聚焦新媒体发展趋势，分享运营经验</div>
                    </div>
                </a>
            </div>
        </div>
    </section>

    <!-- 申请友情链接 -->
    <section class="apply-section">
        <h2 class="apply-title">申请友情链接</h2>
        <p class="apply-description">
            如果您希望与我们交换友情链接，欢迎通过以下方式联系我们。我们会在2-3个工作日内审核并回复。
        </p>
        <a href="#" class="btn-apply" data-bs-toggle="modal" data-bs-target="#applyModal">
            <i class="fas fa-link me-2"></i> 申请交换链接
        </a>
    </section>
</div>

<!-- 申请链接模态框 -->
<div class="modal fade" id="applyModal" tabindex="-1" aria-labelledby="applyModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="applyModalLabel">友情链接申请</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <form id="linkApplyForm">
                    <div class="mb-3">
                        <label for="siteName" class="form-label">网站名称</label>
                        <input type="text" class="form-control" id="siteName" placeholder="请输入您的网站名称" required>
                    </div>
                    <div class="mb-3">
                        <label for="siteUrl" class="form-label">网站URL</label>
                        <input type="url" class="form-control" id="siteUrl" placeholder="请输入您的网站地址，以http://或https://开头"
                               required>
                    </div>
                    <div class="mb-3">
                        <label for="siteCategory" class="form-label">网站分类</label>
                        <select class="form-select" id="siteCategory" required>
                            <option value="">请选择网站分类</option>
                            <option value="tech">科技类</option>
                            <option value="design">设计类</option>
                            <option value="life">生活类</option>
                            <option value="business">商业类</option>
                            <option value="education">教育类</option>
                            <option value="other">其他</option>
                        </select>
                    </div>
                    <div class="mb-3">
                        <label for="siteDesc" class="form-label">网站描述</label>
                        <textarea class="form-control" id="siteDesc" rows="2" placeholder="请简要描述您的网站"
                                  required></textarea>
                    </div>
                    <div class="mb-3">
                        <label for="contactName" class="form-label">联系人</label>
                        <input type="text" class="form-control" id="contactName" placeholder="请输入您的姓名" required>
                    </div>
                    <div class="mb-3">
                        <label for="contactEmail" class="form-label">联系邮箱</label>
                        <input type="email" class="form-control" id="contactEmail" placeholder="请输入您的邮箱地址" required>
                    </div>
                    <div class="form-check mb-3">
                        <input class="form-check-input" type="checkbox" id="agreementCheck" required>
                        <label class="form-check-label" for="agreementCheck">
                            我已在我的网站添加了贵站的链接，且保证所提供的信息真实有效
                        </label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" id="submitApply">提交申请</button>
            </div>
        </div>
    </div>
</div>


<script>
	// 友情链接申请表单处理
	document.getElementById('submitApply').addEventListener('click', function () {
		const form = document.getElementById('linkApplyForm');

		// 简单表单验证
		if (!form.checkValidity()) {
			// 触发浏览器默认验证提示
			form.reportValidity();
			return;
		}

		// 模拟表单提交
		const submitBtn = this;
		const originalText = submitBtn.innerHTML;

		// 显示加载状态
		submitBtn.disabled = true;
		submitBtn.innerHTML = '<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span> 提交中...';

		// 模拟API请求延迟
		setTimeout(() => {
			// 重置按钮状态
			submitBtn.disabled = false;
			submitBtn.innerHTML = originalText;

			// 显示成功消息
			alert('友情链接申请已提交成功！我们会尽快审核并与您联系。');

			// 关闭模态框
			const modal = bootstrap.Modal.getInstance(document.getElementById('applyModal'));
			modal.hide();

			// 重置表单
			form.reset();
		}, 1500);
	});

	// 链接点击统计（示例）
	document.querySelectorAll('.grid-link-item a, .category-link, .icon-link').forEach(link => {
		link.addEventListener('click', function () {
			const linkUrl = this.href;
			const linkName = this.textContent.trim();

			// 在实际应用中，这里会发送统计数据到服务器
			console.log(`友情链接点击: ${linkName} (${linkUrl})`);
		});
	});
</script>

